<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>홈페이지 프로젝트</title>
<SCRIPT LANGUAGE="JavaScript">

		contents = new Array()

		contents[0] = "자바스크립트 강의입니다."
		contents[1] = "참~~ 쉽죠잉~~"
		contents[2] = "재밌나요?"
		contents[3] = "이해가 안되면 재미가 없어요."
		contents[4] = "이해가 되기 시작하면 재밌어져요"
		contents[5] = "힘 내세요!"
		
		pointer = 0
		cont_cnt =0
		expand = true

		function f_expand()
		{
			cont = contents[pointer]
			cont_length = contents[pointer].length

			if (cont_cnt < cont_length)
			{
				cont_cnt++

				if (expand)
				{
					document.title = "+++ " + cont.substring((cont_length - cont_cnt),cont_length) + " +++"
				}
				else
				{
					document.title = "*** " + cont.substring(cont_cnt,cont_length) + " ***"
				}
				
				setTimeout("f_expand()", 5)
			}
			else
			{
				cont_cnt =0

				if (expand)
				{
					expand = false
					setTimeout("f_expand()", 2000)
				}
				else
				{
					expand = true
					pointer++
					if (pointer > contents.length - 1)
					{
						pointer = 0
					}
					setTimeout("f_expand()", 2000)
					
				}

			}

		}


	window.onload  = f_expand

	
	</SCRIPT>
</head>
<body>

</body>
</html>